package com.huanxing.cloud.mall.common.feign;

import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request;
import com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result;
import com.huanxing.cloud.common.core.constant.SecurityConstants;
import com.huanxing.cloud.common.core.constant.ServiceNameConstants;
import com.huanxing.cloud.common.core.entity.Result;
import com.huanxing.cloud.common.feign.config.FeignInterceptor;
import com.huanxing.cloud.pay.common.dto.AliPayRefundRequestDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 支付宝退款feign接口
 *
 * @author lijx
 * @date 2022/6/10
 */
@FeignClient(contextId = "feignAliPayRefundService", value = ServiceNameConstants.PAY_API_SERVICE,
		configuration = FeignInterceptor.class)
public interface FeignAliPayRefundService {

	/**
	 * 支付宝退款
	 *
	 * @author lijx
	 * @date 2022/7/2
	 * @param aliPayRefundRequestDTO
	 * @param source
	 * @return: com.huanxing.cloud.common.core.entity.Result
	 */
	@PostMapping("/alipay/refund")
	Result<AlipayTradeRefundResponse> refund(@RequestBody AliPayRefundRequestDTO aliPayRefundRequestDTO,
			@RequestHeader(SecurityConstants.SOURCE) String source);

	/**
	 * 查询支付宝退款
	 *
	 * @author lijx
	 * @date 2022/7/2
	 * @param aliPayRefundRequestDTO
	 * @param source
	 * @return: com.huanxing.cloud.common.core.entity.Result
	 */
	@GetMapping("/alipay/refund/query")
	Result<AlipayTradeFastpayRefundQueryResponse> queryRefund(
			@RequestBody AliPayRefundRequestDTO aliPayRefundRequestDTO,
			@RequestHeader(SecurityConstants.SOURCE) String source);

}
